Gaze tracking. 🔼

I did this long time ago in SL, but I can't figure out how.

Think it was using the LSL bridge, but that feature seems to have been removed.

https://community.secondlife-staging.com/forums/topic/352325-lsl-function-that-retrieves-the-lookat/ might work in mouselook.


reported=2022-03-11 18:11:03

reporter=onefang

priority=normal

category=Feature

severity=feature

resolution=open


2022-03-11 18:12:14 onefang: From that link -

I'd give you the link to the answer I just posted to your identical question in Answers, but it's just as easy to cut/paste it here again.....

You can't, because there is no such LSL function.  You can answer some of the questions that you might be trying to address in other ways, though.  For example, if you're in mouselook you can use llCastRay to figure out what is along the vector between you and wherever your camera is pointing.  This code snippet

[code=LSL] vector start = llGetCameraPos();

        list results = llCastRay(start, start+<50.0,0.0,0.0>*llGetCameraRot(),[RC_REJECT_TYPES,RC_REJECT_PHYSICAL|RC_REJECT_AGENTS|RC_REJECT_LAND,RC_DETECT_PHANTOM,FALSE,RC_DATA_FLAGS,RC_GET_ROOT_KEY,RC_MAX_HITS,5]);

[/code]

will direct a cast ray 50.0 m from you along your line of sight and will return the UUID and position of the first object that lies along that path.  That's considerably more reliable than the notoriously sloppy LookAt function in your viewer.

ETA: If you want to point your arm in the direction, all you really need is an anim that raises your arm and points straight ahead. Trigger it in the same event that triggers your cast ray and then turn it off a few seconds later with a timer.


2022-03-12 01:25:29 onefang: The old gaze tracking experiment was with Emerald viewer, using stuff they removed long ago.